//
//  YNSUpdatePassWordController.m
//  HNBaseProject
//
//  Created by xujie on 2024/6/23.
//

#import "YNSUpdatePassWordController.h"
#import "YNSPassWordView.h"
@interface YNSUpdatePassWordController ()<MxNavigationViewDelegate>
@property (nonatomic, strong) MxPublicNav *nav;
@property (nonatomic, strong) YNSPassWordView *oldPassV;
@property (nonatomic, strong) YNSPassWordView *passV;//新密码
@property (nonatomic, strong) YNSPassWordView *agaiPassV;
@end

@implementation YNSUpdatePassWordController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self createUI];
}

- (void)createUI {
    
    self.nav = [[MxPublicNav alloc] initWithFrame:CGRectMake(0, 0, kScreenW, kNavBarHeight)];
    self.nav.titleLab.text = @"修改密码";
    self.nav.delegate = self;
    self.nav.line.hidden = NO;
    [self.view addSubview:self.nav];
    
    UILabel *createLab = [[UILabel alloc] init];
    createLab.text = @"支持6-16位英文字母和数字, 不支持特殊字符";
    createLab.textColor = [UIColor colorWithHexString:@"#B7BCCB"];
    createLab.font = PFRFont(12);
    [self.view addSubview:createLab];
    [createLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.offset(kNavBarHeight +23);
        make.centerX.mas_equalTo(self.view);
    }];
    
    self.oldPassV = [[YNSPassWordView alloc] init];
    self.oldPassV.passField.placeholder = @"输入旧密码";
    [self.view addSubview:self.oldPassV];
    [self.oldPassV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.offset(0);
        make.height.mas_equalTo(73);
        make.top.mas_equalTo(createLab.mas_bottom);
    }];
    
    self.passV = [[YNSPassWordView alloc] init];
    self.passV.passField.placeholder = @"请设置新密码";
    [self.view addSubview:self.passV];
    [self.passV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.offset(0);
        make.height.mas_equalTo(73);
        make.top.mas_equalTo(self.oldPassV.mas_bottom);
    }];
    
    self.agaiPassV = [[YNSPassWordView alloc] init];
    self.agaiPassV.passField.placeholder = @"确认新密码";
    [self.view addSubview:self.agaiPassV];
    [self.agaiPassV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.offset(0);
        make.height.mas_equalTo(73);
        make.top.mas_equalTo(self.passV.mas_bottom);
    }];
    
    UILabel *sureLab = [[UILabel alloc] init];
    [self.view addSubview:sureLab];
    sureLab.backgroundColor = [UIColor colorWithHexString:@"#106CFA"];
    sureLab.layer.cornerRadius = 4;
    sureLab.layer.masksToBounds = YES;
    sureLab.textAlignment = NSTextAlignmentCenter;
    sureLab.text = @"确定";
    sureLab.font = PFRFontMedium(18);
    sureLab.userInteractionEnabled = YES;
    sureLab.textColor = [UIColor whiteColor];
    [sureLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(50);
        make.left.offset(15);
        make.right.offset(-15);
        make.top.mas_equalTo(self.agaiPassV.mas_bottom).offset(50);
    }];
    
    MJWeakSelf
    [sureLab addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithActionBlock:^(id  _Nonnull sender) {
        [weakSelf changePassWord];
    }]];
    
    
}

- (void)changePassWord {
    
}

- (void)leftTap {
    [self.navigationController popViewControllerAnimated:YES];
}

@end
